import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/application/education/couser_center/get_text_book_setting_entity.dart';

GetTextBookSettingEntity $GetTextBookSettingEntityFromJson(Map<String, dynamic> json) {
  final GetTextBookSettingEntity getTextBookSettingEntity = GetTextBookSettingEntity();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    getTextBookSettingEntity.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    getTextBookSettingEntity.createBy = createBy;
  }
  final String? createById = jsonConvert.convert<String>(json['createById']);
  if (createById != null) {
    getTextBookSettingEntity.createById = createById;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    getTextBookSettingEntity.createDate = createDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    getTextBookSettingEntity.deleted = deleted;
  }
  final int? duration = jsonConvert.convert<int>(json['duration']);
  if (duration != null) {
    getTextBookSettingEntity.duration = duration;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    getTextBookSettingEntity.id = id;
  }
  final int? isPersonIdentify = jsonConvert.convert<int>(json['isPersonIdentify']);
  if (isPersonIdentify != null) {
    getTextBookSettingEntity.isPersonIdentify = isPersonIdentify;
  }
  final String? textbookId = jsonConvert.convert<String>(json['textbookId']);
  if (textbookId != null) {
    getTextBookSettingEntity.textbookId = textbookId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    getTextBookSettingEntity.updateBy = updateBy;
  }
  final String? updateById = jsonConvert.convert<String>(json['updateById']);
  if (updateById != null) {
    getTextBookSettingEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    getTextBookSettingEntity.updateDate = updateDate;
  }
  return getTextBookSettingEntity;
}

Map<String, dynamic> $GetTextBookSettingEntityToJson(GetTextBookSettingEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createDate'] = entity.createDate;
  data['deleted'] = entity.deleted;
  data['duration'] = entity.duration;
  data['id'] = entity.id;
  data['isPersonIdentify'] = entity.isPersonIdentify;
  data['textbookId'] = entity.textbookId;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  return data;
}

extension GetTextBookSettingEntityExtension on GetTextBookSettingEntity {
  GetTextBookSettingEntity copyWith({
    String? companyCode,
    String? createBy,
    String? createById,
    String? createDate,
    String? deleted,
    int? duration,
    String? id,
    int? isPersonIdentify,
    String? textbookId,
    String? updateBy,
    String? updateById,
    String? updateDate,
  }) {
    return GetTextBookSettingEntity()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createDate = createDate ?? this.createDate
      ..deleted = deleted ?? this.deleted
      ..duration = duration ?? this.duration
      ..id = id ?? this.id
      ..isPersonIdentify = isPersonIdentify ?? this.isPersonIdentify
      ..textbookId = textbookId ?? this.textbookId
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate;
  }
}
